﻿namespace Tester.DL645.Instructions
{
    /// <summary>
    /// 电压指令
    /// </summary>
    public class PhaseVoltageInstruction : GeneralInstruction
    {

        /// <summary>
        /// 
        /// </summary>
        public Core.Phase Phase { get; private set; }
        /// <summary>
        /// A 相处理了
        /// </summary>
        /// <param name="address"></param>
        public PhaseVoltageInstruction(string address, Core.Phase phase)
             : base(address, 0X11, phase == Core.Phase.A ?Core.Constants.APhaseVoltageCommandIdentifier
             : (phase == Core.Phase.B ? new byte[] { 0X02 + 0X33, 0X01 + 0X33, 0X02 + 0X33, 0X33 } : new byte[] { 0X02 + 0X33, 0X01 + 0X33, 0X03 + 0X33, 0X33 }))
        {
            Phase = phase;
        }

    }
}
